home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / language / harvest.cpt / Harvest C / SOURCE CODE < prev    next >
Encoding:
Text File  |  1992-06-17  |  3.3 KB  |  74 lines

  1. Notes on the Harvest C source code
  2.  
  3. You must have THINK C 5.0x to compile Harvest C.
  4.  
  5. The project file contains all the Harvest C source files, plus lots
  6. of TCL files (which you already have), plus several customized libraries.
  7. These libraries are named things like "ANSI 4 byte".  Create these by
  8. copying the appropriate THINK C library, modifying the option settings
  9. to be exactly like those in the Harvest C project, and recompile.
  10.  
  11. There are a number of files included here which are not currently used.
  12. Don't get real upset about this...  For example, I don't think any
  13. of the DObject hierarchy is used.  This was part of a C preprocessor I
  14. was writing for a class project, but did not finish.
  15.  
  16. I didn't write all of the code included here.  The Tool Command
  17. Language was written by John Ousterhout.  Tim Endres and Pete Keleher
  18. and perhaps others even worked on the Mac port of same.  The assembler
  19. routines were obtained from the Motorola BBS.  The malloc library was
  20. written by Tim Endres.
  21.  
  22. You may note that much of the code is hard to read, or not very well written.
  23. You're right.  I wrote Harvest C as a learning experience.  I constantly
  24. learned from my own mistakes.  Some of those mistakes have already been
  25. corrected through rewrites.  Some have not.  Almost invariably, I am
  26. very aware of the deficiencies in this program and its design.  The limiting
  27. factor which keeps me from fixing things is time, not [entirely] knowledge.
  28. The bottom line here is: I am making myself vulnerable by releasing code
  29. which I know is in many ways far from perfect.  I will answer questions.  I
  30. would prefer not to receive gripes or complaints.
  31.  
  32. If you know a lot about compilers, it would probably not be a good idea
  33. to read the code in the parser, lexer, etc...  I know better now.
  34.  
  35. If you are just learning about compilers, read a compiler text.  Your best
  36. learning experience w.r.t. Harvest C will be the ability to identify my
  37. mistakes.  I knew very little when I wrote some of this -- I would do much of it
  38. differently now.
  39.  
  40. Harvest C is badly hurting in terms of source file organization.  Too many
  41. things get included in every file, and the layout of functions among files
  42. does not always make much sense.
  43.  
  44. Harvest C was originally written on a Sun 3, using malloc() for dynamic memory
  45. allocation.  I later ported to the Mac, and used NewHandle().  Anticipating
  46. this change, most struct references look like this
  47.  
  48.     Via(s)->member;
  49.  
  50. instead of
  51.  
  52.     s->member;
  53.  
  54. where Via() is a preprocessor macro which determines whether or not we are
  55. using malloc().  Current memory allocation uses malloc(), so Via expands
  56. to have no effect.
  57.  
  58. You may be thinking about continuing to improve Harvest C and make it
  59. the greatest free C compiler around.  I'd advise that you channel that
  60. enthusiasm into the efforts at porting GCC 2 to the Mac, based partially
  61. on Harvest C's code.  This work is already in progress.  Remember this:
  62.  
  63. "I know Harvest C better than anyone (I wrote it).  I estimate that the
  64. effort necessary for ME to make Harvest C a robust, awesome compiler would be
  65. far greater than the effort necessary to port GCC 2 and integrate the Harvest C
  66. linker and some other things.  If you really want to see a great free C
  67. compiler for the Macintosh, direct your efforts toward GCC.  Read the file
  68. called FUTURE for more info."
  69.  
  70. Eric W. Sink
  71. 1014 Pomona Drive
  72. Champaign, IL  61821
  73. e-sink@uiuc.edu
  74.